<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Server Configuration Reference - The Logger Component</title><meta name="author" value="Craig R. McClanahan"><meta name="email" value="craigmcc@apache.org"></head><body bgcolor="#ffffff" text="#000000" link="#525D76" alink="#525D76" vlink="#525D76"><table border="0" width="100%" cellspacing="0"><!--PAGE HEADER--><tr><td><!--PROJECT LOGO--><a href="http://jakarta.apache.org/tomcat/"><img src="../../images/tomcat.gif" align="right" alt="
    The Tomcat Servlet/JSP Container
  " border="0"></a></td><td><font face="arial,helvetica,sanserif"><h1>Apache Tomcat 4</h1></font></td><td><!--APACHE LOGO--><a href="http://www.apache.org/"><img src="../../images/asf-logo.gif" align="right" alt="Apache Logo" border="0"></a></td></tr></table><table border="0" width="100%" cellspacing="4"><!--HEADER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><tr><!--RIGHT SIDE MAIN BODY--><td width="80%" valign="top" align="left"><table border="0" width="100%" cellspacing="4"><tr><td align="left" valign="top" nowrap="true"><h1>The Logger Component</h1></td><td align="right" valign="top" nowrap="true"><img src="../../images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Introduction"><strong>Introduction</strong></a></font></td></tr><tr><td><blockquote>

  <p>A <strong>Logger</strong> element represents a destination for
  logging, debugging, and error messages (including stack tracebacks)
  for a Catalina container (<a href="engine.html">Engine</a>,
  <a href="host.html">Host</a>, or <a href="context.html">Context</a>).
  In addition, Loggers associated with an Engine or a Host are automatically
  inherited by lower-level containers, unless explicitly overridden.</p>

  <p>If you are interested in producing access logs like a web server does
  (for example, to run hit count analysis software), you will want to configure
  an <a href="valve.html#Access Log Valve">Access Log Valve</a> component on
  your <a href="engine.html#Access Logs">Engine</a>,
  <a href="host.html#Access Logs">Host</a>, or
  <a href="context.html#Access Logs">Context</a>.</p>

  <p>For a more in-depth description of the class loader hierarchy
  that is implemented by Catalina, see <strong>FIXME - Reference</strong>.</p>

    <blockquote><em>
    <p>The description below uses the variable name $CATALINA_HOME
    to refer to the directory into which you have installed Tomcat 4,
    and is the base directory against which most relative paths are
    resolved.  However, if you have configured Tomcat 4 for multiple
    instances by setting a CATALINA_BASE directory, you should use
    $CATALINA_BASE instead of $CATALINA_HOME for each of these
    references.</p>
    </em></blockquote>

</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Attributes"><strong>Attributes</strong></a></font></td></tr><tr><td><blockquote>

  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Common Attributes"><strong>Common Attributes</strong></a></font></td></tr><tr><td><blockquote>

    <p>All implementations of <strong>Logger</strong>
    support the following attributes:</p>

    <table border="1" cellpadding="5"><tr><th width="15%" bgcolor="#023264"><font color="#ffffff">Attribute</font></th><th width="85%" bgcolor="#023264"><font color="#ffffff">Description</font></th></tr><tr><td align="left" valign="center"><strong><code>className</code></strong></td><td align="left" valign="center">
        <p>Java class name of the implementation to use.  This class must
        implement the <code>org.apache.catalina.Logger</code> interface.</p>
      </td></tr><tr><td align="left" valign="center"><code>verbosity</code></td><td align="left" valign="center">
        <p>The verbosity level for this logger.  Messages with a higher
        verbosity level than the specified value will be silently ignored.
        Available levels are 0 (fatal messages only), 1 (errors), 2
        (warnings), 3 (information), and 4 (debug).  If not specified, the
        default value will be 1 (error).</p>

        <p><strong>NOTE</strong> - Only messages logged with an explicit
        verbosity level are compared to this value.  Messages logged with
        no explicit verbosity level are logged unconditionally.</p>
      </td></tr></table>

  </blockquote></td></tr></table>


  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Standard Implementation"><strong>Standard Implementation</strong></a></font></td></tr><tr><td><blockquote>

    <p>Unlike most Catalina components, there are several standard
    <strong>Logger</strong> implementations available.  As a result,
    the <code>className</code> attribute MUST be used to select the
    implementation you wish to use.</p>

    <h3>File Logger (org.apache.catalina.logger.FileLogger)</h3>

    <p>The <strong>File Logger</strong> records all logged messages to
    disk file(s) in a specified directory.  The actual filenames of the
    log files are created from a configured prefix, the current date in
    YYYY-MM-DD format, and a configured suffix.  On the first logged
    message after midnight each day, the current log file will be closed
    and a new file opened for the new date, without having to shut down
    Catalina in order to perform this switch.</p>

    <p>The File Logger supports the following attributes:</p>

    <table border="1" cellpadding="5"><tr><th width="15%" bgcolor="#023264"><font color="#ffffff">Attribute</font></th><th width="85%" bgcolor="#023264"><font color="#ffffff">Description</font></th></tr><tr><td align="left" valign="center"><code>directory</code></td><td align="left" valign="center">
        <p>Absolute or relative pathname of a directory in which log files
        created by this logger will be placed.  If a relative path is
        specified, it is interpreted as relative to $CATALINA_HOME.  If
        no directory attribute is specified, the default value is "logs"
        (relative to $CATALINA_HOME).</p>
      </td></tr><tr><td align="left" valign="center"><code>prefix</code></td><td align="left" valign="center">
        <p>The prefix added to the start of each log file's name.  If not
        specified, the default value is "catalina.".  To specify no prefix,
        use a zero-length string.</p>
      </td></tr><tr><td align="left" valign="center"><code>suffix</code></td><td align="left" valign="center">
        <p>The suffix added to the end of each log file's name.  If not
        specified, the default value is ".log".  To specify no suffix,
        use a zero-length string.</p>
      </td></tr><tr><td align="left" valign="center"><code>timestamp</code></td><td align="left" valign="center">
        <p>Set to <code>true</code> to cause all logged messages to be
        date and time stamped.  Set to <code>false</code> (the default)
        to skip date/time stamping.</p>
      </td></tr></table>

    <h3>Standard Error Logger (org.apache.catalina.logger.SystemErrLogger)</h3>

    <p>The <strong>Standard Error Logger</strong> records all logged messages
    to whatever stream the standard error output of Catalina is pointed at.
    The default Catalina startup script points this at file
    <code>logs/catalina.out</code> relative to $CATALINA_HOME.  This
    logger supports no additional attributes.</p>

    <h3>Standard Output Logger (org.apache.catalina.logger.SystemOutLogger)</h3>

    <p>The <strong>Standard Output Logger</strong> records all logged messages
    to whatever stream the standard output of Catalina is pointed at.
    The default Catalina startup script points this at file
    <code>logs/catalina.out</code> relative to $CATALINA_HOME.  This
    logger supports no additional attributes.</p>

  </blockquote></td></tr></table>


</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Nested Components"><strong>Nested Components</strong></a></font></td></tr><tr><td><blockquote>

  <p>No components may be nested inside a <strong>Logger</strong> element.</p>

</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Special Features"><strong>Special Features</strong></a></font></td></tr><tr><td><blockquote>

  <p>No special features are associated with a <strong>Logger</strong>
  element.</p>

</blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font color="#525D76" size="-1"><em>
        Copyright &copy; 1999-2009, Apache Software Foundation
        </em></font></div></td></tr></table></body></html>